import java.util.Scanner;

public class NGuessNumber {
    Scanner  scan = new Scanner(System.in);
    int [] answers = new int[4];
    int [] guesses= new int[4];
    public  int[] generateAnswers(){
        answers[0] = (int)(Math.random()*10+1);
        int i =1;
        while (i<4){
            int answer = (int)(Math.random()*10+1);
            boolean same = false;
            int j =0;
            while (j<i){
                if (answer==answers[j]){
                    same=true;
                    break;
                }
                j=j+1;
            }
            if (!same){
                answers[j-1]=answer;
                i=i+1;
            }
        }
        return answers;
    }
    public  void receiveGuessess(){

        int i = 0;
        while (i<4){
            try {
                guesses[i] = scan.nextInt();
                i = i+1;
            }catch (Exception e){
                scan.next();
                System.out.println("请重新输入数字");
                continue;
            }
        }
    }

    public static void main(String [] args){
        NGuessNumber ngn = new NGuessNumber();
        int [] answers =  ngn.generateAnswers();
        for(int i= 0;i<answers.length;i++){
            System.out.println(answers[i]);
        }
        ngn.receiveGuessess();
    }
}
